package a4;

public class OrderDetail {
    private int quantity;
    private Product product;

    // Constructors, getters, and setters
    public OrderDetail(int quantity, Product product) {
        this.quantity = quantity;
        this.product = product;
    }

    // Getters and Setters
    public int getQuantity() { return quantity; }
    public void setQuantity(int quantity) { this.quantity = quantity; }
    public Product getProduct() { return product; }
    public void setProduct(Product product) { this.product = product; }

    // Methods
    public double calculateSubTotal() {
        return product.getPriceForQuantity(quantity);
    }

    public double calculateWeight() {
        return product.getWeight() * quantity;
    }
}
